package com.example.tellwin.mine.presenter;

import com.apkfuns.logutils.LogUtils;
import com.example.tellwin.api.TwjfApi;
import com.example.tellwin.base.RxPresenter;
import com.example.tellwin.base.SimpleCallback;
import com.example.tellwin.mine.contract.BindContract;
import com.example.tellwin.mine.contract.FeedBackContract;
import com.example.tellwin.utils.HttpUtils;
import com.google.gson.JsonObject;

import javax.inject.Inject;

import okhttp3.MediaType;
import okhttp3.RequestBody;

/**
 * @author : LinZePeng
 * @date : 2020/12/1
 * @Describe ：
 **/
public class FeedBackPresenter extends RxPresenter<FeedBackContract.View> implements FeedBackContract.Presenter<FeedBackContract.View> {

    private TwjfApi mApi;

    @Inject
    public FeedBackPresenter(TwjfApi mApi) {
        this.mApi = mApi;
    }


    @Override
    public void feedback(String content) {
        RequestBody requestBody = HttpUtils.getRequestBody("content", content);
        mApi.feedback(requestBody, new SimpleCallback<Object>(mView) {
            @Override
            public void onSuccess(Object o) {
                mView.feedbackSuccess();
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }
}
